﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Job.Web.Framework
{
    public class Constants
    {
        public const string RT_BaseContentManager = "01";  //基本内容管理
        public const string RT_HunterJobManager = "02";    //猎头职位管理
        public const string RT_AdminUserManager = "03";    //系统用户管理
      

        private static List<KeyValuePair<String,String>> AdminRights = null ;

        public static List<KeyValuePair<String,String>> GetAdminRights() 
        {
            if ( null == AdminRights ) 
            {
                List<KeyValuePair<String,String>> items 
                    = new List<KeyValuePair<String,String>>();
                items.Add(new KeyValuePair<String,String>(RT_BaseContentManager,"网站内容管理"));
                items.Add(new KeyValuePair<String, String>(RT_HunterJobManager, "猎头职位管理"));
                items.Add(new KeyValuePair<String, String>(RT_AdminUserManager, "系统用户管理"));

                AdminRights = items;
            }
            return AdminRights;
        }


        public enum UserType
        {
            PersonalUser    =1,
            CompanyUser     =2,
            WebSiteAdmin    =3
        }

        //一级栏目所对应的ID，一级栏目叫 Category
        public enum CategoryType
        {
            Company = 10,       //无忧资讯
            Hunter = 11,       //猎头专区
            Service = 12        //人事外包
        }


        //二级栏目所对应的ID，二级栏目叫 Subject
        public enum SubjectType
        {
            CompanyNews = 100,          //无忧新闻
            CompanyDescription = 101,   //关于无忧
            CompanyBBS = 102,           //无忧论坛
            CompanyContactMethod = 103, //联系我们
            CompanyFastList = 104,      //无忧快讯列表
            CompanyFastInfo = 105,      //无忧快讯编辑
            CompanyHRList = 106,        //HR频道列表
            CompanyHRInfo = 107,        //HR频道编辑
            CompanyManagerList = 108,   //管理资讯列表
            CompanyManagerInfo = 109,   //管理资讯编辑
            CompanyIndustryList = 301,  //行业动态列表
            CompanyIndustryInfo = 302,  //行业动态编辑
            
            HunterDescription = 110,    //猎头说明
            HunterPositionList = 111,   //猎头职位列表
            HunterPositionIfo = 112,    //猎头职位编辑
            HunterNewsList = 113,       //猎头资讯列表
            HunterNewsInfo = 114,       //猎头资讯编辑
            HunterManagerArea = 115,    //猎头管理专区
            HunterContactMethod = 116,  //猎头联系方式

            ServiceDescription = 120,       //人事外包业务说明
            ServiceSuggestion = 121,        //人事外包解决方案
            ServiceQuestionList = 122,      //人事外包政策咨询列表
            ServiceQuestionInfo = 123,      //人事外包政策咨询编辑
            ServiceAnalysisList = 124,      //人事外包案例分析列表
            ServiceAnalysisInfo = 125,      //人事外包案例分析编辑
            ServiceContactMethod = 126,     //人事外包联系方式

            AdminManagerList = 200,                //系统管理员列表
            AdminManagerInfo = 201                 //系统管理员编辑
        }

        //根据列表的ID，查询详细页面所对应的ID
        public static int GetInfoIdByListId(int listValue)
        {
            switch (listValue)
            {
                //猎头资讯的转换
                case (int)SubjectType.HunterNewsList:
                    return (int)SubjectType.HunterNewsInfo;
                //人事外包政策咨询转换
                case (int)SubjectType.ServiceQuestionList:
                    return (int)SubjectType.ServiceQuestionInfo;
                //人事外包案例分析转换
                case (int)SubjectType.ServiceAnalysisList:
                    return (int)SubjectType.ServiceAnalysisInfo;
                case (int)SubjectType.CompanyFastList:
                    return (int)SubjectType.CompanyFastInfo;
                case (int)SubjectType.CompanyHRList:
                    return (int)SubjectType.CompanyHRInfo;
                case (int)SubjectType.CompanyIndustryList:
                    return (int)SubjectType.CompanyIndustryInfo;
                case (int)SubjectType.CompanyManagerList:
                    return (int)SubjectType.CompanyManagerInfo;
                default:
                    return listValue;
            }
        }

        //根据详细页面所对应的ID，查询列表的ID
        public static int GetListIdByInfoId(int itemValue)
        {
            switch (itemValue)
            {
                //猎头资讯的转换
                case (int)SubjectType.HunterNewsInfo:
                    return (int)SubjectType.HunterNewsList;
                //人事外包政策咨询转换
                case (int)SubjectType.ServiceQuestionInfo:
                    return (int)SubjectType.ServiceQuestionList;
                //人事外包案例分析转换
                case (int)SubjectType.ServiceAnalysisInfo:
                    return (int)SubjectType.ServiceAnalysisList;
                case (int) SubjectType.CompanyFastInfo:
                    return (int)SubjectType.CompanyFastList;
                case (int)SubjectType.CompanyHRInfo:
                    return (int)SubjectType.CompanyHRList;
                case (int)SubjectType.CompanyIndustryInfo:
                    return (int)SubjectType.CompanyIndustryList;
                case (int)SubjectType.CompanyManagerInfo:
                    return (int)SubjectType.CompanyManagerList;
                default:
                    return itemValue;
            }
        }

    }
}
